#include <iostream>
#include <cstdio>

using namespace std;

int pow[33];
int h,w;
long long sh,sw;
bool run(long long a,long long b,int tt)
{
    double t=(double)a/b;
    if(t>=0.8&&t<=1.25&&a*b>sh*sw)
    {
        sh=a;
        sw=b;
    }
    else if(t<0.8&&tt==0&&a/0.8*a>sh*sw)
    {
        sh=a,sw=a*5/4;
    }
    else if(t>1.25&&tt==1&&1.25*b*b>sh*sw)
    {
        sh=b*5/4,sw=b;
    }
    //printf("%lld & %lld %.4f (%d) -> %lld & %lld\n",a,b,t,tt,sh,sw);
}
int main()
{
    pow[0]=1;
    for(int i=1;i<33;i++) pow[i]=pow[i-1]<<1;
    while(cin>>h>>w)
    {
        sh=sw=0;
        for(int i=30;i>=0;i--)
        {
            if(w>=pow[i]) run(h,pow[i],1);
            if(h>=pow[i]) run(pow[i],w,0);
        }
        cout<<sh<<" "<<sw<<endl;
    }
    return 0;
}
